/*
 * @(#)KeyPair.java	1.7 01/12/12
 *
 * 版权所有2002 Sun MicroSystems，Inc.保留所有权利。Sun专有/机密。使用受许可条款的约束。
 */
 
package java.security;

import java.util.*;
import java.io.*;
/**
 * <p>此类是密钥对(公钥和私钥)的简单持有者。它不强制任何安全性，并且在初始化时应被视为PrivateKey。
 *
 * @see PublicKey
 * @see PrivateKey
 *
 * @version 1.7 01/12/12
 * @author Benjamin Renaud
 */
public final class KeyPair { 

    private PrivateKey privateKey;
    private PublicKey publicKey;

    /**
     * Constructs a key with the specified public key and private key.
     * 
     * @param publicKey the public key.
     * 
     * @param privateKey the private key.
     */
    public KeyPair(PublicKey publicKey, PrivateKey privateKey) {
	this.publicKey = publicKey;
	this.privateKey = privateKey;
    }

    /**
     * Returns the public key from this key pair.
     * 
     * @return the public key.
     */
    public PublicKey getPublic() {
	return publicKey;
    }

     /**
     * Returns the private key from this key pair.
     * 
     * @return the private key.
     */
   public PrivateKey getPrivate() {
	return privateKey;
    }    
}
